package com.woniuxy.education.controller;

import com.woniuxy.education.utils.ResponseResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/jump")
public class JumpController {
    //去登陆
    @ResponseBody
    @RequestMapping("/toLogin")
    public ResponseResult<String> toLogin(){
        ResponseResult<String> result = new ResponseResult<>();
        result.setCode(500);
        result.setData("TO_LOGIN");
        result.setMessage("请登录");
        return  result;
    }

    //没权限
    @ResponseBody
    @RequestMapping("/unauthorized")
    public ResponseResult<String> unauthorized(){
        ResponseResult<String> result = new ResponseResult<>();
        result.setCode(500);
        result.setData("NO_Unauthorized");
        result.setMessage("没权限");
        return  result;
    }

    //去主页面
    @RequestMapping("/main")
    public  String toMain(){
        return "/main.html";
    }

}
